﻿/* ----------------------------------------------------------------------------
 * Copyright (c) Rob Ashton 2009
 *
 * This source code is subject to terms and conditions of the Microsoft Public 
 * License (Ms-PL).
 * 
 * By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 * 
 * To request a copy of the Microsoft Public License, send a request by email
 * to license@mvcex.com
 *
 * This notice must not be removed from this software.
 * ---------------------------------------------------------------------------- */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using MvcEx.Views;

namespace MvcEx.Tests
{
    [TestFixture]
    public class MvcExViewEngineConfigurationTests
    {
        [Test]
        public void add_plugin_to_configuration()
        {
            MvcExViewEngineConfiguration config = new MvcExViewEngineConfiguration("Root");
            config.RegisterComponent("TestComponent");

            Assert.AreEqual("Root", config.Root);
            Assert.AreEqual(1, config.Components.Length);
            Assert.AreEqual("TestComponent", config.Components[0]);
        }

        [Test]
        public void remove_plugin_from_configuration()
        {
            MvcExViewEngineConfiguration config = new MvcExViewEngineConfiguration("");
            config.RegisterComponent("TestComponent");
            config.UnregisterComponent("TestComponent");

            Assert.AreEqual(0, config.Components.Length);
        }
    }
}
